{* Extend our master template *}
{extends file="master.tpl"}

{* This block is defined in the master.php template *}
{block name=content}
    <div class="panel panel-default">
        {include file="components/panel_heading.tpl" title=$title sub_title=$sub_title add_button=TRUE href="users/add"}
        <div class="panel-body">
            <div class="table-responsive">
                <table class="table table-hover table-striped dataTableSimple">
                    <thead>
                        <tr>
                            <th>{'index_fname_th'|lang}</th>
                            <th>{'index_lname_th'|lang}</th>
                            <th>{'index_email_th'|lang}</th>
                            <th>{'index_groups_th'|lang}</th>
                            <th>{'index_status_th'|lang}</th>
                            <th>{'index_action_th'|lang}</th>
                        </tr>
                    </thead>
                    <tbody>
                        {foreach from=$users item=user}
                            <tr>
                                <td>{$user->first_name}</td>
                                <td>{$user->last_name}</td>
                                <td>{$user->email}</td>
                                <td>
                                    {foreach from=$user->groups item=group}
                                        <a href="edit_group/{$group->id}">{$group->name}</a><br />
                                    {/foreach}
                                </td>
                                <td>
                                    {if $user->active} 
                                        <a href="{$ADMIN_URL}users/deactivate/{$user->id}">{'index_active_link'|lang}</a>
                                    {else}
                                        <a href="{$ADMIN_URL}users/activate/{$user->id}">{'index_inactive_link'|lang}</a>
                                    {/if}
                                </td>
                                <td><a href="{$ADMIN_URL}users/edit/{$user->id}" class="btn btn-default tip" title="Edit"><i class="fa {$this->config->item('button_edit')}"></i></a></td>
                            </tr>
                        {/foreach}
                    </tbody>
                </table>
            </div><!-- table-responsive -->
        </div>
    </div>
{/block}